package cn.iocoder.yudao.module.wine.dal.mysql.commissionrate;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wine.dal.dataobject.commissionrate.CommissionRateDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wine.controller.admin.commissionrate.vo.*;

/**
 * 佣金比例配置 Mapper
 *
 * @author 管理员
 */
@Mapper
public interface CommissionRateMapper extends BaseMapperX<CommissionRateDO> {

    default PageResult<CommissionRateDO> selectPage(CommissionRatePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<CommissionRateDO>()
                .eqIfPresent(CommissionRateDO::getRatio, reqVO.getRatio())
                .betweenIfPresent(CommissionRateDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(CommissionRateDO::getId));
    }

}